Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel goto for head #164

Merged
merged 2 commits into from
Jan 12, 2024
Merged

Conversation

glannuzel
Copy link
Member

Add possibility to interrupt a head rotation.

@glannuzel glannuzel linked an issue Jan 10, 2024 that may be closed by this pull request
@@ -214,6 +215,10 @@ def orient(
response = self._goto_stub.GoToJoints(request)
return response

def cancel_goto_by_id(self, goto_id: int) -> GoToAck:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave the same name as for the arm, but the rotation function are called "look_at", "rotate_to" and "orient" for the head. Any idea on how to call the function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancel_rotation?

Copy link
Contributor

@FabienDanieau FabienDanieau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works. Tested with

    reachy.head.orient(pitch=0, roll=0, yaw=0, duration=1.0)
    time.sleep(1)
    req = reachy.head.orient(pitch=180, roll=0, yaw=0, duration=10)
    time.sleep(1)
    reachy.head.cancel_goto_by_id(req)

Should be added to unit test.

@@ -214,6 +215,10 @@ def orient(
response = self._goto_stub.GoToJoints(request)
return response

def cancel_goto_by_id(self, goto_id: int) -> GoToAck:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancel_rotation?

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1287 471 37% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/reachy2_sdk/head.py 38% 🟢
TOTAL 38% 🟢

updated for commit: b5a4497 by action🐍

@glannuzel glannuzel merged commit f775e77 into develop Jan 12, 2024
5 checks passed
@glannuzel glannuzel deleted the 162-goto-for-head-cannot-be-cancelled branch January 12, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Goto for head cannot be cancelled
2 participants